import { App, Plugin } from "vue";

export function withInstall<T extends { name: string }>(c: T) {
  (c as T & Plugin).install = (app: App): void => {
    app.component(c.name, c);
  };
  return c as T & Plugin;
}
